package com.rulin.asp.business.datacleaning;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.rulin.asp.business.entity.Page;

public class QueryParamBean {

	private String keyword;
	
	private Integer quesNo;
	
	private String major;
	
	private String subject;
	
	private Page page;

	public String getKeyword() {
		return keyword;
	}

	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}
	
	public String[] getKeywords() {
		String[] split = StringUtils.split(StringUtils.defaultIfBlank(keyword, ""));
		List<String> newParams = new ArrayList<String>();
		for (String string : split) {
			string = "%"+ string +"%";
			newParams.add(string);
		}
		return (String[]) newParams.toArray(new String[0]);
	}

	public Page getPage() {
		return page;
	}

	public void setPage(Page page) {
		this.page = page;
	}

	public String getMajor() {
		return major;
	}

	public void setMajor(String major) {
		this.major = major;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public Integer getQuesNo() {
		return quesNo;
	}

	public void setQuesNo(Integer quesNo) {
		this.quesNo = quesNo;
	}
}
